package com.ilxqx.framework.system.form.update;

import com.ilxqx.framework.system.enumeration.SysPermissionMethodEnum;
import com.ilxqx.framework.system.form.UpdateForm;
import com.ilxqx.framework.system.form.anno.Pk;
import com.ilxqx.framework.system.validator.anno.Path;
import com.ilxqx.framework.system.validator.group.FrameworkGroups;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * 系统权限更新表单类
 * @author venus
 */
@Data
public class SysPermissionUpdateForm implements UpdateForm {

	/**
	 * 权限ID
	 */
	@Pk
	@NotNull(groups = FrameworkGroups.Modify.class, message = "权限ID{required}")
	@Positive(groups = FrameworkGroups.Modify.class, message = "权限ID{positive}")
	private Long permissionId;

	/**
	 * 父级权限
	 */
	@NotNull(message = "父级权限{required}")
	@PositiveOrZero(message = "父级权限{positiveOrZero}")
	private Long parentPermissionId;

	/**
	 * 名称
	 */
	@NotBlank(message = "名称{required}")
	@Size(max = 32, message = "名称{size}")
	private String name;

	/**
	 * 是否是规则
	 */
	private Boolean rule;

	/**
	 * 请求URI
	 */
	@Size(max = 128, message = "请求URI{size}")
	@Path(message = "请求URI{path}")
	private String uri;

	/**
	 * 请求方法
	 */
	private SysPermissionMethodEnum method;

	/**
	 * 备注
	 */
	@Size(max = 256, message = "备注{size}")
	private String remark;

}
